package com.yungee.learn.controller;

import com.yungee.learn.logic.TrainCourseMediaLogic;
import com.yungee.model.PageData;
import com.yungee.vo.resp.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 培训课程媒体文件 前端控制器
 * </p>
 *
 * @author auto-generate
 * @since 2024-09-06
 */
@RestController
@RequestMapping("/learn/trainCourseMedia")
public class TrainCourseMediaController {
    @Autowired
    private TrainCourseMediaLogic trainCourseMediaLogic;
    /**
     * 列表查询
     * @param page
     * @param size
     * @return
     * @throws Exception
     */
    @GetMapping("/mediaPage")
    public AjaxResult mediaPage(int page, int size, String fileType) throws Exception {
        if (page <= 0){
            page = 1;
        }
        if (size <= 0){
            size = 10;
        }
        PageData pageData =trainCourseMediaLogic.mediaPage(page,size,fileType);
        return AjaxResult.success(pageData);
    }
}
